<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
  <title>字符串</title>
  <link rel="shortcut icon" href="../img/logo.png" type="image/x-icon"/>
  <script>
    let str = 'www.hello world!.txt'
    // 包含 true
    console.log(str.includes('ll'))
    // 结尾 true
    console.log(str.endsWith('.txt'))
    // 开头 true
    console.log(str.startsWith('www'))
    // 前置补齐 '01'
    console.log('1'.padStart(2, '0'))
    // 后置补齐 '1.png'
    console.log('1'.padEnd(5, '.png'))

    //模板字符串
    let st = `<h1 style="color:red;">web17 ${str}</h1> `
    document.write(st)
  </script>
</head>
<body>
<div id="app"><!-- todo --></div>
</body>
</html>
